\begin{tikzpicture}[-stealth,scale=2,transform shape,node distance = 1em]  
    \tikzset{reset join/.code={\def\tikz@after@path{}}}  
    \tikzstyle{every node}=[font=\small,scale=0.6]  
    \begin{scope}[minimum height = 1pt]  
        \tikzstyle{inout}=[trapezium, trapezium left angle=60, trapezium right angle=120, draw] %%输入输出框  
        \tikzstyle{mid}=[rectangle,  opacity=0,draw]   
        \tikzstyle{end}=[rectangle, rounded corners, draw]   %%教材上的起止框  
        \tikzstyle{endn}=[rounded rectangle, draw]   %%新版的起止框  
        \tikzstyle{exec}=[rectangle, draw]    %%执行框 execute  
        \tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black]  % 平行四边形  
        \tikzstyle{decide}=[diamond,aspect=2,draw,thin]   %%判断框 opacity=0.3  
        \node[end] (s) at (0,0) {开始};  
        \node[exec] (m1) at ([yshift=-1em]s.south) {state:=1};  
        \node[mid] [below= of s][fit = (m1)] (s1){};  
        \node[exec] (m2) at ([yshift=-1em]s1.south) {getchar(ch)};  
        \node[mid] [below= of s1][fit = (m2)] (s2){};  
        \node[exec] (s3)at ([yshift=-1em]s2.south) {查变换表:{$\delta(state,ch)=?$}};  
        \node[decide] (d1) [below= of s3] {{$\delta = \varepsilon $}};  
        \node[decide] (d2) [below= of d1] {{$\delta =ok$}};  
        \node[io] (i1) [below= of d2] {回答:ok};  
        \node[end] (e1) [below= of i1] {结束};  
        \node[io](i2) [left= of d2] {回答:no};  
        \node[exec] (s4) [right= of d1] {state:={$\delta$}};  
        \draw (s) -- (m1.north);  
        \draw (m1.south) -- (m2.north);  
        \draw (m2.south) -- (s3.north);  
        \draw (s3) -- (d1);  
        \draw (d1) -- node[right]{n} (d2);  
        \draw (d2) -- node[right]{y} (i1);  
        \draw (i1) -- coordinate[midway](m1) (e1);  
        \draw (s4) |-  ([xshift=-0.05em,yshift=0em]s1.south);  
        \draw (d2) -| node[right]{n} (s4);  
        \draw (d1) -| node[above]{y} (i2);  
        \draw (i2) |- (m1);  

    \end{scope}  
\end{tikzpicture}  